#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "baseserialport.h"
#include <QThread>

QT_BEGIN_NAMESPACE

namespace Ui
{

    class MainWindow;

} // namespace Ui

QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

signals:
    void open(const QString &portName,
              QSerialPort::BaudRate baudRate,
              QSerialPort::DataBits dataBits,
              QSerialPort::Parity parity,
              QSerialPort::StopBits stopBits);
    void close();
    void send(QByteArray data);

private slots:
    void on_UartOn_clicked();

    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;
    QThread serialThread;
    BaseSerialport serialPort;
};
#endif // MAINWINDOW_H
